package team.seekers.catering.service.impl;

import team.seekers.catering.entity.dataobject.Config;
import team.seekers.catering.mapper.ConfigMapper;
import team.seekers.catering.service.ConfigService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 配置表 服务实现类
 * </p>
 *
 * @author hbc
 * @since 2022-03-01
 */
@Service
public class ConfigServiceImpl extends ServiceImpl<ConfigMapper, Config> implements ConfigService {

    @Override
    public Integer getOrderNumber() {
        Config config = getById("1495060882004656129");
        return Integer.parseInt(config.getValue());
    }

    @Override
    public void addOrderNumber() {
        Config config = getById("1495060882004656129");
        Integer number = Integer.parseInt(config.getValue()) + 1;
        config.setValue(number.toString());
        updateById(config);
    }
}
